/**
 * 控制器
 * */
package org.zmhhxl.sample3.oauth2.a.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestCors {

   @GetMapping("/messages")
   public String[] getMessages() {
      return new String[] {"Message 1", "Message 2", "Message 3"};
   }

   @GetMapping("/messages/admin")
   public String[] getMessagesAdmin() {
      return new String[] {"MessageAdmin 1", "Message 2", "Message 3"};
   }

   //不要权限
   @GetMapping("/test/user")
   public String[] getMessagesUser() {
      return new String[] {"不要权限OAuthMessagetestUser 1", "MessageUser 2", "Message 3"};
   }

   @RequestMapping("/test")
   public String[] getMessagesUser1() {
      return new String[] {"不要权限OAuthMessagetest 2", "MessageUser 3", "Message 4"};
   }

   @RequestMapping("/test/")
   public String[] getMessagesUser2() {
      return new String[] {"不要权限OAuthMessage/test/ 3", "MessageUser 3", "Message 4"};
   }

//    @OptionalBottom()
//    public String[] getMessagesUser3() {
//        return new String[] {"Message/test/ 3", "MessageUser 3", "Message 4"};
//    }
}
